%SM_MC2 is a batch program of processing all the data sets.
%The results for each data set is stored in a file res*.txt in the data set directory.

cc=[8,9,10,13,14,15,18,19,20,23,24,25,28,29,30];
for i=1:12
    i
    g=zeros(12,4);
    s=0;
	for j=1:10
        [i,j]
		t0=clock;
        [pts_3d,r,res_ra,res_ra_m,res_ra_u,res_bpe,res_bpe_m,res_bpe_u,res_re,res_re_m,res_re_u,res_ren,res_ren_m,res_ren_u]=sm_main_seeds_2m(strcat('seed_images_10\seed_images_',int2str(cc(i)),'\'),j);
	%	[r,a1,a2,a3,a4,a5,a6]=sm_main4(strcat('seed_images_10\seed_images_',int2str(cc(i)),'\'),j)%7)%3)
        res=[res_ra;...
                res_ra_m;...
                res_ra_u;...
                res_bpe;...
                res_bpe_m;...
                res_bpe_u;...
                res_re;...
                res_re_m;...
                res_re_u;...
                res_ren;...
                res_ren_m;...
                res_ren_u];
        g=g+res;
        s=s+r;
        t1=etime(clock,t0)
		save(strcat('seed_images_10\seed_images_',int2str(cc(i)),'\resnew_',int2str(j),'.txt'),'r','res','-ASCII');
	end
    g=g/10
    s=s/10
    save(strcat('seed_images_10\seed_images_',int2str(cc(i)),'\resnew_all.txt'),'s','g','-ASCII');
end